<script setup>
  import {useRouter} from 'vue-router'
  import {ref} from 'vue'
  const router = useRouter()

  function showDetail(id,language){
    router.push(`/showDetail/${id}/${language}`)
  
  }

  function showDetail2(id,language){
    router.push(`/showDetail2?id=${id}&language=${language}`)

  }
</script>

<template>
  <div>
    
    <router-link to ="/showDetail2?id=1&language=java">声明式路由键值对传参</router-link>
    <button @click="showDetail2(2,'PHP')">编程式路由键值对传参</button>
    <hr>


    <router-view></router-view>
  </div>
</template>

<style scoped>

</style>
